using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace DeepThought
{
	[Serializable]
	public class DeepThought
	{
		private char[] _THE_answer;
		private char[] _key;

		public DeepThought()
		{
		}

		#region GETTER_SETTERS
		public char[] get_key()
		{
			return _key;
		}

		public char[] get_THE_answer()
		{
			return _THE_answer;
		}

		public void set_THE_answer(char[] value)
		{
			_THE_answer = value;
		}

		public void set_key(char[] value)
		{
			_key = value;
		}
		#endregion

		public void display_field()
		{
			Console.WriteLine("Here is the key of the Vingenere encryption : " + new string(_key));
			Console.WriteLine("Here is the answer of the question... : " + new string(_THE_answer));
			Console.ReadLine();
		}

		public static char[] hash(char[] message)
		{
			MD5 md5hash = MD5.Create();

			byte[] result = md5hash.ComputeHash(Encoding.UTF8.GetBytes(message));
			StringBuilder sBuilder = new StringBuilder();

			for (int i = 0 ; i < result.Length ; i++)
				sBuilder.Append(result[i].ToString("x2"));

			return sBuilder.ToString().ToCharArray();
		}

	}
}
